<?php include_partial('global/navbar') ?>
<div class="next_head">
</div>
<div class="next_head">
    <div class="wrap">
        <a href="<?php echo url_for('account/myloan')?>">还款中</a>
        <a href="<?php echo url_for('account/published')?>"  class="on">已发布</a>
    </div>
</div>
<div class="content_nav">
    <?php if($pager->getNbResults() <= 0):?>
        <div class="tag_nav wrap">
            <div class="nodata">
                您没有 已发布 的借款列表
            </div>
        </div>
    <?php else:?>
        <div class="tag_nav wrap">

            <div class="col-xs-12 pd-n">
                <h4>已发布的借款列表 </h4>
                <hr />
                <table class="table table-hover ">
                    <thead>
                        <tr>
                            <th>标题</th>
                            <th>类型</th>
                            <th>金额</th>
                            <th>年利率</th>
                            <th>期限</th>
                            <th>进度</th>
                            <th>创建时间</th>
                            <th>状态</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($pager->getResults() as $k=>$result):?>
                            <tr>
                                <td><a href="<?php echo url_for('project/index?id='.$result->getId())?>" title="<?php echo $result->getTitle();?>"><?php echo $result->getTitle();?></a></td>
                                <td><?php if($result->getListType()==6){
                                  echo "";
                                }else{
                                  echo $type_list[$result->getListType()];
                                }?></td>
                                <td><?php echo sfConfig::get('app_symbol').number_format($result->getMoney(),2);?></td>
                                <td>                                         
                                    <?php if($result->getListType() == 3):?>
                                            <?php echo number_format($result->getMoneyRate(),0)."%"?>
                                            <?php else:?>
                                            <?php echo $result->getMoneyRate()-2?>%+ 2%
                                        <?php endif;?></td>
                                <td><?php if($result->getIsDay()=="0"){
                                  echo $result->getTermNum().' 月';
                                }else{
                                  echo $result->getTermNum().' 天';
                                }?></td>
                                <td><?php echo $result->getJin($result->getMoney());?></td>
                                <td><?php echo date("Y-m-d", strtotime($result->getCreatedAt()))?></td>
                                <td><?php echo $result->getStatusName(); ?></td>
                            </tr>
                            <?php endforeach;?>
                    </tbody>
                </table>
                <?php $uri = url_for("account/published")?>
                <ul class="pagination pagination-lg ft-r">
                <?php echo pager_navigation($pager, $uri); ?>
                </ul>
            </div>
        </div>
    <?php endif;?>
</div>
<script >
    $("#10003,#10009").addClass("on");
</script>
